package cn.myjerry.test.JDBC;


import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * 测试使用JDBCUtil
 * @author Jerry
 *
 */
public class Demo10 {
	public static void main(String[] args) {
		Connection conn = null;
		PreparedStatement ps = null;
		ResultSet res = null;
		
		try {
			conn = JDBCUtil.getMysqlConn();
			ps = conn.prepareStatement("select * from User where Id = 3009");
			res = ps.executeQuery();
			System.out.println(res.next());
			
			
			
		} catch (SQLException e) {
			e.printStackTrace();
		} finally {
			JDBCUtil.close(res, ps, conn);
		}
	}
}
